package com.happy.manage.service.impl;

import java.util.Date;
import java.util.List;

import com.happy.manage.domain.HotSearchTermVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.happy.manage.mapper.UserSearchTermsMapper;
import com.happy.manage.domain.UserSearchTerms;
import com.happy.manage.service.IUserSearchTermsService;

/**
 * 用户搜索词记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-28
 */
@Service
public class UserSearchTermsServiceImpl implements IUserSearchTermsService 
{
    @Autowired
    private UserSearchTermsMapper userSearchTermsMapper;

    /**
     * 查询用户搜索词记录
     * 
     * @param searchId 用户搜索词记录主键
     * @return 用户搜索词记录
     */
    @Override
    public UserSearchTerms selectUserSearchTermsBySearchId(Long searchId)
    {
        return userSearchTermsMapper.selectUserSearchTermsBySearchId(searchId);
    }

    /**
     * 查询用户搜索词记录列表
     * 
     * @param userSearchTerms 用户搜索词记录
     * @return 用户搜索词记录
     */
    @Override
    public List<UserSearchTerms> selectUserSearchTermsList(UserSearchTerms userSearchTerms)
    {
        return userSearchTermsMapper.selectUserSearchTermsList(userSearchTerms);
    }

    /**
     * 新增用户搜索词记录
     * 
     * @param userSearchTerms 用户搜索词记录
     * @return 结果
     */
    @Override
    public int insertUserSearchTerms(UserSearchTerms userSearchTerms)
    {
        return userSearchTermsMapper.insertUserSearchTerms(userSearchTerms);
    }

    /**
     * 修改用户搜索词记录
     * 
     * @param userSearchTerms 用户搜索词记录
     * @return 结果
     */
    @Override
    public int updateUserSearchTerms(UserSearchTerms userSearchTerms)
    {
        return userSearchTermsMapper.updateUserSearchTerms(userSearchTerms);
    }

    /**
     * 批量删除用户搜索词记录
     * 
     * @param searchIds 需要删除的用户搜索词记录主键
     * @return 结果
     */
    @Override
    public int deleteUserSearchTermsBySearchIds(Long[] searchIds)
    {
        return userSearchTermsMapper.deleteUserSearchTermsBySearchIds(searchIds);
    }

    /**
     * 删除用户搜索词记录信息
     * 
     * @param searchId 用户搜索词记录主键
     * @return 结果
     */
    @Override
    public int deleteUserSearchTermsBySearchId(Long searchId)
    {
        return userSearchTermsMapper.deleteUserSearchTermsBySearchId(searchId);
    }

    @Override
    public List<HotSearchTermVO> selectHotSearchTerms(Date startTime, Date endTime) {
        return userSearchTermsMapper.selectHotSearchTerms(startTime, endTime);
    }
}
